package day3.lesson06

class Pair[T <: Comparable[T]] {
  def shuai(first:T,second:T):T={
    if(first.compareTo(second) < 0) first else second
  }

}

object Test2{
  def main(args: Array[String]): Unit = {
    val boy1 = new Boy("鹿晗",99)
    val boy2 = new Boy("于男",98)

    val p = new Pair[Boy]
    val boy = p.shuai(boy1,boy2)
    println(boy.name)

  }
}

